getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Sat, 4 Apr 2020 17:43:56 +0000 (18:43 +0100)
committerRyan Tandy <ryan@nardis.ca>
Sat, 4 Apr 2020 17:43:56 +0000 (18:43 +0100)
commit06434001449084be3e382ae3dcd2b7efedf23383
tree4539bf5e2ae19b6b3717e8cde38cb09073cd5c22
parentc5bf4f8de47d44701082a45ee1e43f242f791fb8
getaddrinfo-is-threadsafe

OpenLDAP upstream conservatively assumes that certain resolver functions
(getaddrinfo, getnameinfo, res_query, dn_expand) are not re-entrant; but we
know that the glibc implementations of these functions are thread-safe, so
we should bypass the use of this mutex.  This fixes a locking problem when
an application uses libldap and libnss-ldap is also used for hosts
resolution.

Closes Debian bug #340601.

Not suitable for forwarding upstream; might be made suitable by adding a
configure-time check for glibc and disabling the mutex only on known
thread-safe implementations.

Gbp-Pq: Name getaddrinfo-is-threadsafe
libraries/libldap/os-ip.c
libraries/libldap/util-int.c